package com.example.myhuangye.BX;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.example.myhuangye.R;

public class MainBX0ctivity extends AppCompatActivity implements View.OnClickListener{

    private Button bx6,bx7,bx8,bx9;
    private ImageButton bxcall6,bxcall7,bxcall8,bxcall9;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_bx0ctivity);
        bx6= (Button) findViewById(R.id.bx6);
        bx6.setOnClickListener(this);
        bxcall6= (ImageButton) findViewById(R.id.bxcall6);
        bxcall6.setOnClickListener(this);

        bx7= (Button) findViewById(R.id.bx7);
        bx7.setOnClickListener(this);
        bxcall7= (ImageButton) findViewById(R.id.bxcall7);
        bxcall7.setOnClickListener(this);

        bx8= (Button) findViewById(R.id.bx8);
        bx8.setOnClickListener(this);
        bxcall8= (ImageButton) findViewById(R.id.bxcall8);
        bxcall8.setOnClickListener(this);

        bx9= (Button) findViewById(R.id.bx9);
        bx9.setOnClickListener(this);
        bxcall9= (ImageButton) findViewById(R.id.bxcall9);
        bxcall9.setOnClickListener(this);
        findViewById(R.id.HT50).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }//回退//

    public void onClick(View view) {//点击事件//
        switch (view.getId()){
            case R.id.bx6:
                Uri uri = Uri.parse("http://www.yaic.com.cn");
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);

                break;
            case R.id.bxcall6:
                Intent intent1=  new Intent(Intent.ACTION_DIAL);
                intent1.setData(Uri.parse("tel:95502"));
                startActivity(intent1);
                break;

            case R.id.bx7:
                Uri uri1 = Uri.parse("http://www.newchinalife.com");
                Intent intent2 = new Intent(Intent.ACTION_VIEW, uri1);
                startActivity(intent2);

                break;
            case R.id.bxcall7:
                Intent intent3=  new Intent(Intent.ACTION_DIAL);
                intent3.setData(Uri.parse("tel:95567"));
                startActivity(intent3);
                break;

            case R.id.bx8:
                Uri uri2 = Uri.parse("http://www.tk.cn");
                Intent intent4 = new Intent(Intent.ACTION_VIEW, uri2);
                startActivity(intent4);

                break;
            case R.id.bxcall8:
                Intent intent5=  new Intent(Intent.ACTION_DIAL);
                intent5.setData(Uri.parse("tel:95522"));
                startActivity(intent5);
                break;

            case R.id.bx9:
                Uri uri3 = Uri.parse("http://www.capli.com.cn");
                Intent intent6 = new Intent(Intent.ACTION_VIEW, uri3);
                startActivity(intent6);

                break;
            case R.id.bxcall9:
                Intent intent7=  new Intent(Intent.ACTION_DIAL);
                intent7.setData(Uri.parse("tel:95592"));
                startActivity(intent7);
                break;


        }


    }



}




